package cn.com.dingtek.genius.manager.server.repository.db.manager;

import cn.com.dingtek.genius.manager.server.repository.db.entity.StaffDeviceApp;
import cn.com.dingtek.genius.manager.server.repository.db.mapper.StaffDeviceAppMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class StaffDeviceAppManager extends ServiceImpl<StaffDeviceAppMapper, StaffDeviceApp> {

    public StaffDeviceApp getStaffDeviceApp(Long staffId, Long deviceId) {
        return getOne(Wrappers.<StaffDeviceApp>query().eq("staff_base_id", staffId).eq("device_base_id", deviceId));
    }

    public void remove(Long staffId, Long deviceId) {
        remove(Wrappers.<StaffDeviceApp>query().eq("staff_base_id", staffId).eq("device_base_id", deviceId));
    }
}
